﻿using System;
using System.IO;

class ReplaceSubstring
{
    static void Main()
    {
        StreamReader readFile = new StreamReader("oldfile.txt");
        StreamWriter writeFile = new StreamWriter("newfile.txt");
        using (readFile)
        {
            using (writeFile)
            {
                string line = readFile.ReadLine();
                while (line != null)
                {
                    line = line.Replace("start", "finish");
                    writeFile.WriteLine(line);
                    Console.WriteLine(line);
                    line = readFile.ReadLine();
                }

            }
        }
    }
}

